package com.irdstudio.efp.report.service.dao;

import com.irdstudio.efp.loan.service.vo.LoanRepayPlanVO;
import com.irdstudio.efp.report.service.domain.ZxbsLoanRepayPlan;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * DAO Interface:
 *
 * @author gcb
 * @date 2020-07-28
 */
public interface ZxbsLoanRepayPlanDao {
    /**
     * 新增数据
     *
     * @param zxbsLoanRepayPlan
     * @return
     */
    int insert(ZxbsLoanRepayPlan zxbsLoanRepayPlan);

    /**
     * 根据主键删除信息
     *
     * @param zxbsLoanRepayPlan
     * @return
     */
    int deleteByPk(ZxbsLoanRepayPlan zxbsLoanRepayPlan);

    /**
     * 根据主键更新信息
     *
     * @param zxbsLoanRepayPlan
     * @return
     */
    int updateByPk(ZxbsLoanRepayPlan zxbsLoanRepayPlan);

    /**
     * 根据主键查询详情
     *
     * @param zxbsLoanRepayPlan
     * @return
     */
    ZxbsLoanRepayPlan queryByPk(ZxbsLoanRepayPlan zxbsLoanRepayPlan);

    int insertOrUpdate(List<ZxbsLoanRepayPlan> list);

    /**
     * 根据借据号获取逾期的还款计划的结清日期（取得是还款计划期数最小得）
     * @param list
     * @return
     */
    List<ZxbsLoanRepayPlan> queryMinOverdueStmtDates(@Param("list") List<String> list);

    /**
     * 根据批次号查询当前期数: <br>
     * 0.1:caoxin:2019/6/27 19:09: 根据批次号查询当前期数:<br>
     * @author caoxin
     * @return
     * @since 2019/6/27 19:09
     * @date 2019/6/27 19:09
     * @version 0.1
     */
    Integer queryCurrentTerm(@Param("batchDate") String date,@Param("billNo") String billNo);

    /**
     * 根据借据号查询所有还款计划
     *
     * @param list 借据号列表
     * @return
     */
    List<ZxbsLoanRepayPlan> queryRepayPlansByRefNbr(@Param("list") List<String> list);

    /**
     * 根据贷款账号查询逾期的还款计划: <br>
     *
     * 0.1:caoxin:2019/6/27 17:50: 根据贷款账号查询逾期的还款计划: <br>
     * @author caoxin
     * @return
     * @since 2019/6/27 17:50
     * @date 2019/6/27 17:50
     * @version 0.1
     */
    List<ZxbsLoanRepayPlan> queryRepayPlanByRefNbrAndStatus(LoanRepayPlanVO loanRepayPlanVO);
}